﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using VupSlashLauncher.Common;

namespace VupSlashLauncher.View
{
    /// <summary>
    /// SettingViewThemeSettingView.xaml 的交互逻辑
    /// </summary>
    public partial class SettingViewThemeSettingView : UserControl
    {
        public SettingViewThemeSettingView()
        {
            InitializeComponent();
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            ThemeColorTextChange();
        }

        private void ThemeColorTitle_Click(object sender, MouseButtonEventArgs e)
        {
            if (ThemeColorTitle.Opacity > 0.06)
            {
                ThemeColorTitle.Opacity -= 0.05;
            }
            else
            {
                if (GlobalValues.ThemeColorTitle == "Strange")
                {
                    ThemeColorTitle.Opacity = 1;
                    GlobalValues.ThemeColorTitle = "Normal";
                    ThemeColorTextChange();
                }
                else
                {
                    ThemeColorTitle.Opacity = 1;
                    GlobalValues.ThemeColorTitle = "Strange";
                    ThemeColorTextChange();
                }
            }
        }
        private void ThemeColorTitle_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            ThemeColorTitle.Opacity = 1;
        }
        private void ThemeColorTextChange()
        {
            if (GlobalValues.ThemeColorTitle == "Strange")
            {
                ThemeColorTitle.Opacity = 1;
                _1ColorCheckButton.Content = "雷姆蓝";
                _2ColorCheckButton.Content = "姨妈红";
                _3ColorCheckButton.Content = "非酋黑";
                _4ColorCheckButton.Content = "拉姆粉";
                _5ColorCheckButton.Content = "基佬紫";
                _6ColorCheckButton.Content = "狗屎黄";
                _7ColorCheckButton.Content = "帽子绿";
                _8ColorCheckButton.Content = "自定义";
            }
            else
            {
                ThemeColorTitle.Opacity = 1;
                _1ColorCheckButton.Content = "穹天蓝";
                _2ColorCheckButton.Content = "朱雀赤";
                _3ColorCheckButton.Content = "寰宇黑";
                _4ColorCheckButton.Content = "湘妃粉";
                _5ColorCheckButton.Content = "葛巾紫";
                _6ColorCheckButton.Content = "琥珀缇";
                _7ColorCheckButton.Content = "翡翠绿";
                _8ColorCheckButton.Content = "自定义";
            }
        }
    }
}
